<template>
  <div class="app-container">
    <div class="b-g-f p-20">
      首页
    </div>
    <div style="width:600px;height:600px">
      <yl-charts :option="option" />
    </div>
    <div style="width:600px;height:600px">
      <v-chart :options="polar" />
    </div>
    <v-chart :options="polar" />
  </div>
</template>

<script>
import YlCharts from '@/components/Charts/ylCharts.vue'
export default {
  name: 'Home',
  components: {
    YlCharts
  },
  data() {
    const data = []

    for (let i = 0; i <= 360; i++) {
      const t = (i / 180) * Math.PI
      const r = Math.sin(2 * t) * Math.cos(2 * t)
      data.push([r, i])
    }
    return {
      option: {
        title: {
          text: 'ECharts 入门示例'
        },
        tooltip: {},
        xAxis: {
          data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
        },
        yAxis: {},
        series: [
          {
            name: '销量',
            type: 'bar',
            data: [5, 20, 36, 10, 10, 20]
          }
        ]
      },
      polar: {
        title: {
          text: '极坐标双数值轴'
        },
        legend: {
          data: ['line']
        },
        polar: {
          center: ['50%', '54%']
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'cross'
          }
        },
        angleAxis: {
          type: 'value',
          startAngle: 0
        },
        radiusAxis: {
          min: 0
        },
        series: [
          {
            coordinateSystem: 'polar',
            name: 'line',
            type: 'line',
            showSymbol: false,
            data: data
          }
        ],
        animationDuration: 2000
      }
    }
  },
  computed: {},
  created() {},
  methods: {}
}
</script>
<style lang="scss">
.echarts {
  width: 100%;
  height: 100%;
}
</style>
